home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / ms_sh21s.zip / SH210 / PATCH.LIB < prev    next >
Text File  |  1992-12-14  |  3KB  |  100 lines

  1.  MS-DOS Shell Version 2.1    Patch.Lib            Decmeber 1992
  2.  
  3.  MS-DOS SHELL - Copyright (c) 1990,1,2 Data Logic Limited and Charles Forsyth
  4.  
  5.  This code is based on (in part) the shell program written by Charles
  6.  Forsyth and is subject to the following copyright restrictions:
  7.  
  8.  1.  Redistribution and use in source and binary forms are permitted
  9.      provided that the above copyright notice is duplicated in the
  10.      source form and the copyright notice in file sh6.c is displayed
  11.      on entry to the program.
  12.  
  13.  2.  The sources (or parts thereof) or objects generated from the
  14.      sources (or parts of sources) cannot be sold under any circumstances.
  15.  
  16.     $Header: /usr/users/istewart/src/shell/sh2.1/Release/RCS/Patch.lib,v 2.1 1992/12/14 11:13:55 istewart Exp $
  17.  
  18.     $Log: Patch.lib,v $
  19.     Revision 2.1  1992/12/14  11:13:55  istewart
  20.     BETA 215 Fixes and 2.1 Release
  21.  
  22.     Revision 2.0  1992/04/13  17:40:33  Ian_Stewartson
  23.     MS-Shell 2.0 Baseline release
  24.  
  25.     
  26. ________________________________________________________________________________
  27.  
  28. This document provides a set of instructions for modifying the Microsoft C
  29. v5.1 Library function open so that the O_NOINHERIT flag is passed to MSDOS.
  30. The CodeView commands are given where appropriate.
  31.  
  32. 1.  Using CodeView (or a similar debugger), set a breakpoint on the call to
  33.     open in S_open.
  34.  
  35.     - v S_open
  36.     move cursor to open
  37.     - <F9>
  38.  
  39. 2.  Execute to the break point.  You may have to enter a command which opens
  40.     a file.
  41.  
  42.     - g
  43.  
  44. 3.  Display the Assembly listing
  45.  
  46.     - <F3>
  47.  
  48. 4.  Single step the debugger into the open function
  49.  
  50.     - <F8> (5 times on my system)
  51.  
  52. 5.  Page through the assembler listing until you find the Interrupt 21 call.
  53.     In my version, this is about 16 assembler instructions into the open
  54.     function.  The call sequence is:
  55.  
  56.     mov        byte ptr [bp - 4], 80H
  57.     push    ds
  58.     lds        dx, dword ptr [bp + 6]
  59.     and        al, 03
  60.     or        al, bh
  61.     mov        ah, 3d
  62.     int        21H
  63.  
  64. 6.  Record the machine code values for this sequence (especially the last 4
  65.     instructions).  On my system these are:
  66.  
  67.     2403    and        al, 03
  68.     0AC7    or        al, bh
  69.     B43D    mov        ah, 3d
  70.     CD21    int        21H
  71.  
  72. 7.  Exit CodeView
  73.  
  74. 8.  Extract the module open.obj from your library.
  75.  
  76.     lib llibce "*open.obj;"
  77.  
  78. 9.  Using an appropriate binary editor (or hex dump program) look for the
  79.     sequence of machine code values leading up to the interrupt (see step 6
  80.     above).  In my version of open.obj, it starts at offset 0x0f2 in the
  81.     file.  Change the AND AL, 03 instruction to AND AL, 83 by changing 24
  82.     03 to 24 83.
  83.  
  84.     You may have to write a little program to open the file in binary mode,
  85.     seek to the appropriate location and write 0x83 to the file and close
  86.     it.
  87.  
  88. 10. Re-load the module in the library (you may want to keep a copy of the
  89.     original module/library in case of problems).
  90.  
  91.     lib llibce "-+open.obj;"
  92.  
  93. 11. Re-link the shell
  94.  
  95. 12. Check that the AND AL, 03 has become an AND AL, 83 using steps 1 to 5.
  96.  
  97. Note:
  98.     Microsoft, MSDOS and CodeView are registered trademarks of Microsoft
  99.     Corporation
  100.